package com.dsbj.mp.icardservice.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsbj.common.msg.ResponseMessage;
import com.dsbj.mp.icardservice.entity.Recommend;
import com.dsbj.mp.icardservice.entity.SysCompany;
import com.dsbj.mp.icardservice.mapper.RecommendMapper;
import com.dsbj.mp.icardservice.mapper.SysCompanyMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 员工推荐
 */
@Service
@Transactional
public class RecommendService extends ServiceImpl<RecommendMapper, Recommend> {

    @Resource
    private SysCompanyMapper sysCompanyMapper;

    public ResponseMessage getAllCompany(){
        QueryWrapper<SysCompany> queryWrapper = new QueryWrapper<SysCompany>()
                .select("id", "COMPANYNO", "COMPANYNAME")
                .orderByAsc("COMPANYNO");
        List<SysCompany> sysCompanyList = sysCompanyMapper.selectList(queryWrapper);
        return ResponseMessage.ok(sysCompanyList);
    }

}
